package com.example.newstop.adapter;

import java.util.List;
import java.util.Map;

import com.example.newstop.R;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

public class SimpleRecyclerAdapter
extends RecyclerView.Adapter<SimpleRecyclerAdapter.MyViewHolder>{

	private List<Map<String, Object>> data;

	public SimpleRecyclerAdapter(@NonNull List<Map<String, Object>> data) {
		this.data = data;
		// TODO Auto-generated constructor stub
	}
	class MyViewHolder extends RecyclerView.ViewHolder
	{

		private ImageView iv;
		private TextView tv;

		public MyViewHolder(View itemView) {
			super(itemView);
			iv = (ImageView) itemView.findViewById(R.id.iv);
			tv = (TextView) itemView.findViewById(R.id.tv);
		}
		
	}
	@Override
	public int getItemCount() {
		// TODO Auto-generated method stub
//		return data==null?0:data.size();
		return 20;
	}

	@Override
	public void onBindViewHolder(MyViewHolder vh, int position) {
//		vh.iv.setImageDrawable((Drawable) data.get(position).get(0));
//		vh.tv.setText((CharSequence) data.get(position).get(1));
	}

	@Override
	public MyViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
		View view = LayoutInflater.from(viewGroup.getContext())
				.inflate(R.layout.item_drawer, null);
				
		return new MyViewHolder(view);
	}
	}
